package com.wf.demo.info.dao;

import com.wf.demo.info.pojo.Alarm;
import com.wf.demo.info.pojo.Device;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import java.time.LocalDateTime;
import java.util.List;

public interface AlarmDAO extends JpaRepository<Alarm,Long> {
    //单个设备的所有故障记录
    Page<Alarm>findByDevice(Device device, Pageable pageable);
    //查找
    List<Alarm> findByDeviceAndEndTime(Device device, LocalDateTime endTime);
    List<Alarm>  findByDevice(Device device);
}
